package com.xshang.controller;

import com.xshang.service.TenantService;
import com.xshang.service.UserService;
import com.xshang.util.JsonUtil;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/v1/tenant_user/user")
public class UserController {

    @Resource
    private UserService userService;

    @Resource
    private TenantService tenantService;

    @GetMapping("/user_list")
    public String findUserList() {
        return userService.userList();
    }

    @GetMapping("/tenant_list")
    public String findTenantList() {
        return JsonUtil.objToJson(tenantService.findAll());
    }
}
